<?
require_once($r."_engine/table_editor/c_table_editor.php");

class CTableEditorEmSt extends CTableEditor
{
	function OnPrintData($f, &$v)
	{
		if (@$f['type'] == "mail")
		{
			$v = substr($v, 0, 200);
			$v = htmlspecialchars($v);
			$v = str_replace("=0D=0A", "\n", $v);
			$v = str_replace("=0A", "\n", $v);
			$v = "<pre>" . $v . "</pre>";
			return;
		}

		$this->OnPrintDataStd($f, $v);
	}
}

$te_em_st = new CTableEditorEmSt();
$te_em_st->Init();
$te_em_st->table_name = "emails_storage";
$te_em_st->page_name  = "emails_storage";
$te_em_st->fields = 
	array(
		array('name'=>"id",				'title'=>"ID"),
		array('name'=>"account_id",		'title'=>"Account ID"),
		array('name'=>"monitor_id",		'title'=>"Monitor ID"),
		array('name'=>"send_time",		'title'=>"Send Time"),
		array('name'=>"send_status",	'title'=>"Send Status"),
		array('name'=>"alert_emails",	'title'=>"Alert E-mails"),
		array('name'=>"email_content",	'title'=>"Content",			'type'=>"mail"),
	);
    
$te_em_st->order = "ORDER BY id DESC LIMIT 0, 30";
$te_em_st->allow_edit = false;

?>